package com.utils;

import java.util.UUID;

/**
 * @author cuichf
 * @version 1.0.0
 * @date 2016-11-06 下午4:50:59
 * @description UUID生成
 */
public class UUIDUtil {

    public static String createUUid() {
        return UUID.randomUUID().toString();
    }

    public static String createUUIDByString(String key , boolean islink) {
        String ret =  null ;
        ret = key.hashCode() + "-" + UUID.randomUUID().toString();
        ret = islink?ret:ret.replace("-", "");
        return ret;
    }
    
    public static String createUUID(String key) {
        String ret = "";
        ret = key + "-" + UUID.randomUUID().toString();
        ret = ret.replace("-", "");
        return ret;
    }
    
    
    public static void main(String[] args){
        System.out.println(UUIDUtil.createUUID("ORDER"));
    }
    
}
